﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;

namespace EFCore_Test.AppDBContext
{
    public class ApplicationContextFactory : IDesignTimeDbContextFactory<ApplicationContext>
    {
        public ApplicationContext CreateDbContext(string[] args)
        {
            var optionsBuilder = new DbContextOptionsBuilder<ApplicationContext>();
            optionsBuilder.UseSqlServer("server=.;database=EFCoreTestModel;uid=sa;pwd=123456;TrustServerCertificate=true");
            return new ApplicationContext(optionsBuilder.Options);
        }
    }
}